<template>
  <view>
    <u-tabbar
        :value="tabIndex"
        @change="handleChange">
      <u-tabbar-item v-for="(item,index) in tabs" :key="index" :text="item.title" :icon="item.icon"
                     @click="handleClickTab(item.url)"></u-tabbar-item>
    </u-tabbar>
  </view>
</template>

<script setup lang="ts">
import {useProductStore} from "@/store/product";
import {storeToRefs} from "pinia";


const productStore = useProductStore()
const {tabIndex, tabs} = storeToRefs(productStore)


const handleChange = (e: any) => {
  tabIndex.value = e
}
const handleClickTab = (url: string) => {
  uni.redirectTo({
    url: url
  })
}

const handleManage=()=>{

}

</script>

<style scoped>

</style>